﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace MikroMagazaObject
{
    public partial class frmGeniusSatisAktarim : XtraForm
    {
        public int MagazaNo { get; set; }
        public string SrmMerkezi { get; set; }
        public string OpaPath { get; set; }
        private bool interaktarim;
        public string KasaCnn { get; set; }
        public string KdvSiralamasi { get; set; }

        public frmGeniusSatisAktarim(bool inter)
        {
            InitializeComponent();
            interaktarim = inter;
        }

        private void btnAktar_Click(object sender, EventArgs e)
        {
            Aktarim ak = new Aktarim(interaktarim);
            ak.MagazaNo = MagazaNo;
            ak.SrmMerkezi = SrmMerkezi;
            ak.OpaPath = OpaPath;
            ak.YenidenAktar(dateEdit1.DateTime);
            ak.KasaCnn = KasaCnn;
            ak.KdvSiralamasi = KdvSiralamasi;

            foreach (string item in ak.Start(dateEdit1.DateTime))
            {
                progressBarControl1.Properties.Minimum = 0;
                progressBarControl1.Properties.Maximum = Cevir.Parse<int>(item.Split(';')[0]);
                progressBarControl1.Position = Cevir.Parse<int>(item.Split(';')[1]);
                progressBarControl1.Refresh();
            }
        }

        private void frmGeniusSatisAktarim_Load(object sender, EventArgs e)
        {
            dateEdit1.DateTime = DateTime.Now;
        }
    }
}
